package com.hhd.cwqs.controller;

import com.hhd.cwqs.entity.QsModel;
import com.hhd.cwqs.qs.CwqsDelegate;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cwqs")
public class CwqsController {

    @Autowired
    CwqsDelegate cwqsDelegate;

    @PostMapping("/qs")
    public Result qs(@RequestBody QsModel qsModel) {
        cwqsDelegate.doQs(
                qsModel.getSourceDataSourceId(),
                qsModel.getTargetDataSourceId(),
                qsModel.getUnitId(),
                qsModel.getMonth(),
                qsModel.getYear(), qsModel.getAccountingSystem(),
                "手动触发"
        );
        return Result.ok("采集成功");
    }
}
